﻿Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace DotNetNuke.Modules.ActiveForums.Controls
    <DefaultProperty("Text"), ToolboxData("<{0}:HtmlControlLoader runat=server></{0}:HtmlControlLoader>")> _
    Public Class HtmlControlLoader
        Inherits Control
        Public Property ControlId() As String
        Public Property Height() As String
        Public Property Width() As String
        Public Property Name() As String
        Public Property FilePath() As String
        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
            Me.EnableViewState = False
            FilePath = HttpContext.Current.Server.MapPath(FilePath)
            Dim sControl As String = Utilities.GetFile(FilePath)
            sControl = sControl.Replace("{id}", ControlId)
            sControl = sControl.Replace("{height}", Height)
            sControl = sControl.Replace("{width}", Width)
            sControl = sControl.Replace("{name}", Name)
            writer.Write(sControl)
        End Sub

    End Class
End Namespace

